package com.xmy.cultivate.mapper;

import com.xmy.cultivate.entity.BookTextSubjects;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 书对应的科目 Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2025-06-04
 */
public interface BookTextSubjectsMapper extends BaseMapper<BookTextSubjects> {

    @Select("SELECT GROUP_CONCAT(subjects_id) AS result FROM book_text_subjects WHERE book_text_id = #{bookTextId}")
    String getSubjectsIdByBookTextId(@Param("bookTextId") Long bookTextId);

}
